package com.xl.deploy.gui;

import com.xl.deploy.service.DeploymentPackageService;
import com.xl.deploy.service.impl.DeploymentPackageServiceImpl;
import java.awt.Toolkit;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with 徐立
 *
 * @author 徐立
 * @version 1.0 2019-10-25 19:05
 * To change this template use File | Settings | File Templates.
 * @date 2019-10-25
 * @time 19:05
 */
@Configuration
public class AppConfig {
    @Bean
    public DeploymentPackageService getDeploymentPackageService() {
        return new DeploymentPackageServiceImpl();
    }
    
    @Bean
    public DeployForm getDeployForm() {
        DeployForm deployForm = new DeployForm();
        deployForm.setAlwaysOnTop(true);
        deployForm.pack();
        int width = Toolkit.getDefaultToolkit().getScreenSize().width;
        int height = Toolkit.getDefaultToolkit().getScreenSize().height;
        deployForm.setLocation(width / 2 - deployForm.getWidth() / 2, height / 2 - deployForm.getHeight() / 2);
        return deployForm;
    }
}
